home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / filutil / pa_st270.zip / POM.DOC < prev    next >
Text File  |  1995-02-01  |  54KB  |  1,225 lines

  1.  
  2.     ===========================================================================
  3.     ===========================================================================
  4.     ============================                   ============================
  5.     ============================                   ============================
  6.     ============================   PARSE-O-MATIC   ============================
  7.     ============================                   ============================
  8.     ============================                   ============================
  9.     ===========================================================================
  10.     ===========================================================================
  11.     
  12.  
  13.  
  14.     ---------------------------------------------------------------------------
  15.     |                                                                         |
  16.     |        HERE ARE A FEW OF THE THINGS PARSE-O-MATIC CAN DO FOR YOU:       |
  17.     |                                                                         |
  18.     |      Importing             Exporting             Automated Editing      |
  19.     |      Text Extraction       Data Conversion       Table Lookup           |
  20.     |      Retabulation          Info Weeding          Selective Copying      |
  21.     |      Binary-File to Text   Report Reformatting   Wide-Text Folding      |
  22.     |      Auto-Batch Creation   Comm-log Trimming     Tab Replacement        |
  23.     |      Character Filtering   Column Switching      DBF Interpretation     |
  24.     |                                                                         |
  25.     |      "Parse-O-Matic is a wonderful time saver .... Each report that     |
  26.     |      I can convert from our ... accounting system saves our company     |
  27.     |      about 500 man hours per year" -- R. Brooker (a happy POM user)     |
  28.     |                                                                         |
  29.     ---------------------------------------------------------------------------
  30.  
  31.  
  32.  
  33.                    Parse-O-Matic is Copyright (C) 1992, 1995 by:
  34.  
  35.            Pinnacle Software, CP 386 Mount Royal, Quebec, Canada H3P 3C6
  36.            U.S. Office: Box 714 Airport Road, Swanton, Vermont 05488 USA
  37.  
  38.            Support Line (514) 345-9578 --- Free Files BBS (514) 345-8654
  39.  
  40.  
  41.  
  42.     ---------------------------------------------------------------------------
  43.     |                                                                         |
  44.     |                                                                         |
  45.     |      This is a SHAREWARE product.  That means we would like you to      |
  46.     |      pass around unregistered copies to other people.  If you have      |
  47.     |      a modem, you can upload a copy to a local BBS, or give a copy      |
  48.     |      to a friend who will save time and effort with Parse-O-Matic.      |
  49.     |                                                                         |
  50.     |                                                                         |
  51.     ---------------------------------------------------------------------------
  52.                                                                                
  53.  
  54.  
  55.     ===========================================================================
  56.                                       OVERVIEW
  57.     ===========================================================================
  58.  
  59.  
  60.     INTRODUCTION
  61.     ------------
  62.     Why you need Parse-O-Matic -- an example
  63.     Parse-O-Matic to the rescue!
  64.     How it works
  65.  
  66.     FUNDAMENTALS
  67.     ------------
  68.     The Parse-O-Matic command
  69.     The POM file
  70.     Padding for clarity
  71.  
  72.     COMMAND WORDS
  73.     -------------
  74.     The SET command
  75.     The IF command
  76.     The BEGIN and END commands
  77.     The OUT and OUTEND commands
  78.     The OUTHDG and PAGELEN commands
  79.     The MINLEN command
  80.     The IGNORE command
  81.     The ACCEPT command
  82.     The TRIM command
  83.     The PAD command
  84.     The INSERT command
  85.     The CHANGE command
  86.     The SPLIT command
  87.     The CHOP command
  88.     The LOOKUP command
  89.     The LOOKFILE command
  90.     The LOOKCOLS command
  91.     The LOOKSPEC command
  92.     The TRACE command
  93.  
  94.     TERMS AND TECHNIQUES
  95.     --------------------
  96.     Values
  97.     Delimiters
  98.     Illegal characters
  99.     Incrementing
  100.     Line counters
  101.     Tracing
  102.     Quiet mode
  103.     DBF Files
  104.     Converting comma-delimited files
  105.     Examples
  106.  
  107.  
  108.  
  109.     ===========================================================================
  110.                                     INTRODUCTION
  111.     ===========================================================================
  112.  
  113.  
  114.     Parse-O-Matic is a programmable file-parser.  Simple enough for even a non-
  115.     programmer to master, it can help out in countless ways.  Here are some of
  116.     the things Parse-O-Matic can do:  Importing, Exporting, Automated Editing,
  117.     Text Extraction, Data Conversion, Table Lookup, Retabulation, Info Weeding,
  118.     Selective Copying, Binary-File to Text, Tab Replacement, Reformatting,
  119.     Wide-Text Folding, Auto-Batch Creation, Character Filtering, Column
  120.     Switching, DBF Interpretation, Report Generation, and more!
  121.                             
  122.  
  123.                       ----------------------------------------
  124.                       WHY YOU NEED PARSE-O-MATIC -- AN EXAMPLE
  125.                       ----------------------------------------
  126.  
  127.     There are plenty of programs out there that have valuable data locked away
  128.     inside them.  How do you get that data OUT of one program and into another
  129.     one?
  130.  
  131.     Some programs provide a feature which "exports" a file into some kind of
  132.     generic format.  Perhaps the most popular of these formats is known as a
  133.     "comma-delimited file", which is a text file in which each data field is
  134.     separated by a comma.  Literal strings -- which might themselves contain
  135.     commas -- are surrounded by double quotes.  So a few lines from a
  136.     comma-delimited file might look something like this (an export from a
  137.     hypothetical database of people who owe your company money):
  138.  
  139.     +-------------------------------------------------------------------------+
  140.     |      "JONES","FRED","1234 GREEN AVENUE", "KANSAS CITY", "MO",293.64     |
  141.     |      "SMITH","JOHN","2343 OAK STREET","NEW YORK","NY",22.50             |
  142.     |      "WILLIAMS","JOSEPH","23 GARDEN CRESCENT","TORONTO","ON",16.99      |
  143.     +-------------------------------------------------------------------------+
  144.  
  145.     Unfortunately, not all programs export or import data in this format.
  146.     Even more frustrating is a program that exports data in a format that is
  147.     ALMOST what you need!
  148.  
  149.     If that's the case, you might decide to spend a few hours in a text editor,
  150.     modifying the export file so that the other program can understand it.  Or
  151.     you might write a program to do the editing for you. Both solutions are
  152.     time-consuming.
  153.  
  154.     An even more challenging problem arises when a program which has no export
  155.     capability does have the ability to "print" reports to a file.  You can
  156.     write a program to read these files and convert them to something you can
  157.     use, but this can be a LOT of work!
  158.  
  159.  
  160.                             ----------------------------
  161.                             PARSE-O-MATIC TO THE RESCUE!
  162.                             ----------------------------
  163.  
  164.     Parse-O-Matic is a utility that reads text, fixed-length and DBF (DBase)
  165.     files, interprets the data, and outputs the result to a text file.  It can
  166.     help you "boil down" reports into their essential data.  You can also use
  167.     it to convert NEARLY compatible import files, or generate printable
  168.     reports.
  169.  
  170.                                     ------------
  171.                                     HOW IT WORKS
  172.                                     ------------
  173.  
  174.     You need three things:
  175.  
  176.     1) The Parse-O-Matic program
  177.     2) A Parse-O-Matic "POM" file (to tell Parse-O-Matic what to do)
  178.     3) The input file
  179.  
  180.     The input file is usually a report from another program, a fixed record
  181.     length data file, or a DBF (DBase) file.  We've provided several examples
  182.     of typical input files. For example, the file EXAMPLE2.TXT comes from the
  183.     AccPac accounting software.  AccPac is a great program, but its export
  184.     capabilities leave something to be desired.  Parse-O-Matic can help!
  185.  
  186.     To see detailed demonstrations of how these files can be parsed, enter
  187.     START at the DOS prompt, then select EXAMPLES.
  188.  
  189.  
  190.  
  191.     ===========================================================================
  192.                                     FUNDAMENTALS
  193.     ===========================================================================
  194.    
  195.  
  196.     This documentation assumes that you are an experienced computer user.  If
  197.     you have trouble, you might ask a programmer to help you -- POM file
  198.     creation is a little like programming!
  199.                           
  200.  
  201.                              -------------------------
  202.                              THE PARSE-O-MATIC COMMAND
  203.                              -------------------------
  204.  
  205.     The basic format of the Parse-O-Matic command line is:
  206.  
  207.         POM pom-file input-file output-file
  208.  
  209.     Here is an example, as you would type it at the DOS command line:
  210.  
  211.         POM POMFILE.POM REPORT.TXT OUTPUT.TXT
  212.  
  213.     For a more formal description of the command line, start up POM by typing
  214.     this command at the DOS prompt:
  215.  
  216.         POM
  217.  
  218.                                     ------------
  219.                                     THE POM FILE
  220.                                     ------------
  221.  
  222.     The POM file is a text file with a .POM extension.  The following
  223.     conventions are used when interpreting the POM file:
  224.  
  225.     - Null lines and lines starting with a semi-colon (comments) are ignored.
  226.  
  227.     - A POM file may contain up to 500 lines of specifications.
  228.       Comment lines do not count in this total.
  229.  
  230.     A POM file contains no "loops" (to use the programming term).  Each line of
  231.     the input file is processed by the entire POM file.  If you'd like it
  232.     expressed in terms of programming languages, here's what POM does:
  233.  
  234.     +-------------------------------------------------------------------------+
  235.     |      START: If there's nothing left in the input file, go to QUIT.      |
  236.     |             Read a line from the input file                             |
  237.     |             Do everything in the POM file                               |
  238.     |             Go to START                                                 |
  239.     |      QUIT:  Tell the user you're finished!                              |
  240.     +-------------------------------------------------------------------------+
  241.  
  242.  
  243.                                 -------------------
  244.                                 PADDING FOR CLARITY
  245.                                 -------------------
  246.  
  247.     Spaces and tabs between the words and variables in a POM file line are
  248.     generally ignored (except in the case of the OUT and OUTEND commands).  You
  249.     can use spaces to make your POM files easier to read.
  250.  
  251.     Additionally, in any line in the POM file, the following terms are ignored:
  252.  
  253.         =   THEN   ELSE
  254.  
  255.     These can be added to make the lines easier to read.  For example, the IF
  256.     command can be written in any of the following ways:
  257.  
  258.         Very terse:          IF PRICE "0.00" BONUS "0.00" "1.00"
  259.  
  260.         Padded with spaces:  IF PRICE   "0.00"   BONUS   "0.00"   "1.00"
  261.  
  262.         Fully padded:        IF PRICE = "0.00" THEN BONUS = "0.00" ELSE "1.00"
  263.  
  264.  
  265.  
  266.     ===========================================================================
  267.                                    COMMAND WORDS
  268.     ===========================================================================
  269.  
  270.  
  271.     For ease of learning, the commands words are explained in the following
  272.     order:
  273.  
  274.     +-------------------------------------------------------------------------+
  275.     |                                                                         |
  276.     |  COMMANDS WHICH WILL...              LIST OF COMMANDS                   |
  277.     |  ----------------------------------  ---------------------------------  |
  278.     |  Break up an input line into fields  SET IF                             |
  279.     |  Control processing flow             BEGIN END                          |
  280.     |  Generate or control output          OUT OUTEND OUTHDG PAGELEN          |
  281.     |  Accept or reject input              MINLEN IGNORE ACCEPT               |
  282.     |  Alter fields                        TRIM PAD INSERT CHANGE             |
  283.     |  Preprocess input                    SPLIT CHOP                         |
  284.     |  Look up data in another file        LOOKUP LOOKFILE LOOKCOLS LOOKSPEC  |
  285.     |  Trace processing                    TRACE                              |
  286.     |                                                                         |
  287.     +-------------------------------------------------------------------------+
  288.  
  289.  
  290.     Here is a quick-reference table of all the commands.  The following conven-
  291.     tions are used in the table:
  292.  
  293.     "var"   means a variable that is being set.
  294.     "value" means a variable whose value is being read.
  295.     Square brackets [like this] indicate optional items.
  296.  
  297.  
  298.     -------------------------------------------  ------------------------------
  299.     COMMAND FORMATS                              EXAMPLE
  300.     ===========================================  ==============================
  301.     SET      var1 value1                         SET     NAME $FLINE[20 26]
  302.     IF       value1 value2 var1 value3 [value4]  IF      X = "Y" THEN Z = "N"
  303.     -------------------------------------------  ------------------------------
  304.     BEGIN    value1 value2                       BEGIN   LINECNTR = "3"
  305.     END                                          END
  306.     -------------------------------------------  ------------------------------
  307.     OUT      [value1 value2] |output-picture     OUT     "X" "X" |{PRICE}
  308.     OUTEND   [value1 value2] |output-picture     OUTEND  "X" "X" |{$FLINE}
  309.     OUTHDG   value1                              OUTHDG  "LIST OF EMPLOYEES"
  310.     PAGELEN  value1 [value2]                     PAGELEN "66" "N"
  311.     -------------------------------------------  ------------------------------
  312.     MINLEN   value1                              MINLEN  "15"
  313.     IGNORE   value1 value2                       IGNORE  PRICE "0.00"
  314.     ACCEPT   value1 value2                       ACCEPT  $FLINE[1 3] "YES"
  315.     -------------------------------------------  ------------------------------
  316.     TRIM     var1 spec1 character                TRIM    PRICE "R" "$"
  317.     PAD      var1 spec1 character len            PAD     SERIALNUM "L" "0" "10"
  318.     INSERT   var1 spec1 value1                   INSERT  PRICE "L" "$"
  319.     CHANGE   var1 value1 value2                  CHANGE  DATE "/" "-"
  320.     -------------------------------------------  ------------------------------
  321.     SPLIT    from to [,from to] [...]            SPLIT   1 250, 251 300
  322.     CHOP     from to [,from to] [...]            CHOP    1 250, 251 300
  323.     -------------------------------------------  ------------------------------
  324.     LOOKUP   var1 value1                         LOOKUP   PHONENUM "FRED JONES"
  325.     LOOKFILE value1                              LOOKFILE "C:\TABLES\DATA.TBL"
  326.     LOOKCOLS value1 value2 value3 value4         LOOKCOLS "1" "3" "8" "255"
  327.     LOOKSPEC value1 value2 value3                LOOKSPEC "Y" "N" "N"
  328.     -------------------------------------------  ------------------------------
  329.     TRACE    var1                                TRACE    PRICE
  330.     -------------------------------------------  ------------------------------
  331.  
  332.  
  333.     The commands are explained in more detail (and in the same order) in the
  334.     following sections.
  335.  
  336.  
  337.                                   ---------------
  338.                                   The SET Command
  339.                                   ---------------
  340.  
  341.                               FORMAT:  SET var1 value1
  342.  
  343.     SET assigns a value to a variable.  The usual reason to do this is to set a
  344.     variable from the input line (represented by the variable $FLINE) prior to
  345.     cleaning it up with TRIM. For example, if the input line looked like this:
  346.  
  347.         JOHN       SMITH     555-1234   322 Westchester Lane    Architect
  348.         |          |         |          |                       |
  349.         Column 1   Col 12    Col 22     Col 33                  Col 57
  350.  
  351.     then we could extract the last name from the input line with these two POM
  352.     commands:
  353.  
  354.         SET  NAME = $FLINE[12 21]      (Sets the variable from the input line)
  355.         TRIM NAME  "R"  " "            (Trims any spaces on the right side)
  356.  
  357.     SET would first set the variable NAME to this value:     "SMITH     "
  358.     After the TRIM, the variable NAME would have the value:  "SMITH"
  359.  
  360.     You will also use SET if you plan to include a substring of $FLINE in the
  361.     output, since the OUT and OUTEND commands do not recognize substrings after
  362.     the "|" marker, only complete variables.
  363.                                 
  364.  
  365.                                    --------------
  366.                                    The IF Command
  367.                                    --------------
  368.  
  369.                    FORMAT:  IF value1 value2 var1 value3 [value4]
  370.  
  371.     If value1 contains value2, var1 is set to value3.  Otherwise, it is set to
  372.     value4.  If value4 is missing, nothing is done (i.e.  var1 is not changed).
  373.     Here's an example of the IF command...
  374.  
  375.         SET  EARNING = $FLINE[20 26]
  376.         TRIM EARNING  "A"  " "
  377.         IF   EARNING = "0.00" THEN BONUS = "0.00" ELSE "1.00"
  378.  
  379.     This would obtain the value between columns 20 and 26, remove any spaces,
  380.     then check if it equals "0.00".  If it does, the variable BONUS is set to
  381.     0.00.  If not, BONUS is set to "1.00".
  382.                           
  383.  
  384.                              --------------------------
  385.                              The BEGIN and END Commands
  386.                              --------------------------
  387.  
  388.               The format for the BEGIN and END commands is as follows:
  389.  
  390.                                 BEGIN value1 value2
  391.                                 :
  392.                                 Dependant code
  393.                                 :
  394.                                 END
  395.  
  396.     If value1 equals value2, then the dependant code (the POM lines between
  397.     the BEGIN and the END) are executed.  If value1 does not equal value2,
  398.     then the dependant code is skipped.
  399.  
  400.     It is traditional in programming to indent code that appears in blocks
  401.     such as Parse-O-Matic's BEGIN/END technique.  This makes the logic of
  402.     the program easier to understand.  For example:
  403.  
  404.     BEGIN datatype = "Employee"
  405.       SET phone    = $FLINE[ 1 10]
  406.       SET address  = $FLINE[12 31]
  407.     END
  408.  
  409.     BEGIN/END blocks can be nested.  That is to say, you can have BEGIN/END
  410.     blocks inside other BEGIN/END blocks.  Here is an example, with arrows
  411.     to indicate the levels of each BEGIN/END block...
  412.  
  413.     BEGIN datatype = "Employee"      <---------------------
  414.       SET phone    = $FLINE[ 1 10]                        |
  415.       SET address  = $FLINE[12 31]                        |
  416.       SET areacode = phone[1 3]                           | First
  417.       BEGIN areacode = "514"         <------- Second      | Level
  418.         SET local = "Y"                     | Level       | Block
  419.         SET tax   = "Y"              <------- Block       |
  420.       END                                                 |
  421.     END                              <---------------------
  422.  
  423.     In this case, the "inner" block (starting with BEGIN areacode = "514")
  424.     would only be reached if the "outer" block (BEGIN datatype = "Employee")
  425.     was true.  If the outer block was false, the inner block would never be
  426.     executed.
  427.  
  428.     A nested BEGIN/END block must always be completely inside the outer
  429.     block.  Study the following (incorrect) example:
  430.  
  431.     BEGIN datatype = "Employee"             <----
  432.       SET phone    = $FLINE[ 1 10]              |  First
  433.       SET areacode = phone[1 3]                 |  Level
  434.       BEGIN areacode = "514"         <---       |  Block?
  435.         SET local = "Y"                 |       |
  436.     END                                 |   <----
  437.       SET tax = "Y"                     |
  438.       END                            <---  Second Level Block?
  439.  
  440.     Parse-O-Matic does not pay attention to the indenting -- it is only a
  441.     tradition we use to make the file easier to read.  The code will be
  442.     understood this way:
  443.  
  444.     BEGIN datatype = "Employee"      <---------------------
  445.       SET phone    = $FLINE[ 1 10]                        | First
  446.       SET areacode = phone[1 3]                           | Level
  447.       BEGIN areacode = "514"         <--- Second          | Block
  448.         SET local = "Y"                 | Level           |
  449.       END                            <--- Block           |
  450.       SET tax = "Y"                                       |
  451.     END                              <---------------------
  452.  
  453.     You can nest BEGIN/END blocks up to 25 deep.  (It is quite unlikely you
  454.     will ever actually need that much nesting)  Here is an example of code
  455.     that uses nesting up to three deep:
  456.  
  457.     BEGIN datatype = "Dog"           <----------------------------------
  458.       SET breed = $FLINE[1 10]                                         | First
  459.       BEGIN breed = "Collie"         <-----------------------          | Level
  460.         SET sound = "Woof"                                  | Second   | Block
  461.         BEGIN name = "Spot"          <------ Third          | Level    |
  462.           SET attitude = "Friendly"        | Level          | Block    |
  463.         END                          <------ Block          |          |
  464.       END                            <-----------------------          |
  465.       BEGIN breed = "Other"          <----------------------- Another  |
  466.         SET sound = "Arf"                                   | Second   |
  467.         SET attitude = "Unknown"                            | Level    |
  468.       END                            <----------------------- Block    |
  469.     END                              <----------------------------------
  470.  
  471.     Once again, the indentation is for clarity only and does not affect the
  472.     way the POM file runs.  However, you will find that it makes your POM
  473.     file much easier to understand.
  474.                          
  475.  
  476.                             ---------------------------
  477.                             The OUT and OUTEND Commands
  478.                             ---------------------------
  479.  
  480.                  FORMAT:  OUT[END] [value1 value2] |output-picture
  481.  
  482.     The OUT command generates output without an end-of-line (i.e. carriage
  483.     return and linefeed characters).  The OUTEND command generates output and
  484.     also adds an end-of-line.
  485.  
  486.     When value1 matches value2 (or if the comparison is omitted), a line is
  487.     output to the output file, according to the output picture.  Within the
  488.     output picture, all text is taken literally (i.e. " is taken to mean
  489.     literally that -- a quotation mark character).
  490.  
  491.     The only exception to this is variable names, which are identified by the
  492.     { and } characters.  For example, a POM file that contained the following
  493.     single line:
  494.  
  495.         OUTEND "X" = "X" |{$FLINE}
  496.  
  497.     would simply output every line from the input file (not very useful!).
  498.  
  499.     The "X" = "X" part of the command is the comparator which controls when
  500.     output occurs; if both parts of the comparator are both forced to the same
  501.     value, output will always occur.
  502.  
  503.     NOTE: For efficiency, OUT does not write immediately to the output file; it
  504.     accumulates the output until it reaches 255 characters before writing.  You
  505.     must do an OUTEND command to ensure that the data is actually written.
  506.  
  507.     You can not use substrings after the "|" marker.  Thus, the following line
  508.     is NOT legal:
  509.  
  510.         OUTEND $FLINE[1 3] = "IBM" |{$FLINE[1 15]}
  511.  
  512.     The correct way to code this is as follows:
  513.  
  514.         SET CODE = $FLINE[1 15]
  515.         OUTEND $FLINE[1 3] = "IBM" |{CODE}
  516.  
  517.     This would output the first 15 characters of any line that contains the
  518.     letters IBM in the first three positions.
  519.  
  520.  
  521.                           -------------------------------
  522.                           The OUTHDG and PAGELEN Commands
  523.                           -------------------------------
  524.  
  525.                          FORMAT:  OUTHDG value1
  526.                          FORMAT:  PAGELEN value1 [value2]
  527.  
  528.     OUTHDG is used to place text headers in your output.  For example, if you
  529.     were parsing data to create an employee report, you might use OUTHDG like
  530.     this:
  531.  
  532.         SET EMPNUM = $FLINE[ 1  5]
  533.         SET NAME   = $FLINE[10 28]
  534.         SET PHONE  = $FLINE[30 45]
  535.         OUTHDG "EMPL#  NAME                PHONE NUMBER"
  536.         OUTHDG "-----  ------------------- ------------"
  537.         OUTEND |{EMPNUM} {NAME} {PHONE}
  538.  
  539.     The value following the OUTHDG command is sent to the output file only
  540.     once.  That is to say, after an OUTHDG sends a value to the output file,
  541.     subsequent encounters with that OUTHDG command are ignored -- unless the
  542.     PAGELEN command is used.
  543.  
  544.     The PAGELEN command specifies the length of the output page.  Lines from
  545.     both OUTHDG and OUTEND are counted.  The default value for page length is
  546.     zero, which means that the output is a single page of infinite length.  As
  547.     such, OUTHDG headings appear only the first time they are encountered.
  548.  
  549.     If you specify a page length greater than zero, OUTHDG headings become
  550.     re-enabled once the specified number of output lines have been generated.
  551.     A typical value is as follows:
  552.  
  553.         PAGELEN "55"
  554.  
  555.     This is an ideal page length for most laser printers.  Dot matrix printers
  556.     typically use a page length of 66.
  557.  
  558.     Parse-O-Matic inserts a "form feed" (ASCII 12) character between pages.
  559.     You can turn this off, however, by specifying the page length this way:
  560.  
  561.         PAGELEN "66" "N"
  562.  
  563.     The "N" specification means, "No, don't use form feeds".  Another
  564.     acceptable value is "Y", meaning "Yes, use form feeds", but since this is
  565.     the default, you do not have to specify it.
  566.  
  567.  
  568.                                  ------------------
  569.                                  The MINLEN Command
  570.                                  ------------------
  571.  
  572.                                FORMAT:  MINLEN value1
  573.  
  574.     MINLEN specifies the minimum length a line must be to be considered for
  575.     parsing.  If you omit the MINLEN command, the minimum length is assumed to
  576.     be 1.  That is to say, all lines 1 character or longer will be processed
  577.     and shorter lines (null lines in other words) will be ignored.
  578.  
  579.     MINLEN is useful for ignoring brief information lines that clutter up a
  580.     report that you are parsing.  For example, in the sample file EXAMPLE2.POM,
  581.     the MINLEN command is set to 85 to ensure that all lines shorter than 85
  582.     characters long will be ignored.  This simplifies the coding considerably.
  583.  
  584.     The longest allowable input line is 255 characters, unless you use the
  585.     SPLIT or CHOP command (described later).
  586.                               
  587.  
  588.                                  ------------------
  589.                                  The IGNORE Command
  590.                                  ------------------
  591.  
  592.                            FORMAT:  IGNORE value1 value2
  593.  
  594.     When value1 contains value2, the input line is ignored and all further
  595.     processing on the input line stops.  The usual format of this command is as
  596.     in this example:
  597.  
  598.         IGNORE $FLINE[3 9] = "Date"
  599.  
  600.     This would skip any input line that contains the word "Date" between
  601.     columns 3 and 9 ($FLINE is the line just read from the input file).
  602.                               
  603.  
  604.                                  ------------------
  605.                                  The ACCEPT Command
  606.                                  ------------------
  607.  
  608.                            FORMAT:  ACCEPT value1 value2
  609.  
  610.     The ACCEPT command accepts the input line if value1 contains value2.  For
  611.     example, if the entire POM file read as follows:
  612.  
  613.         ACCEPT $FLINE[15 17] = "YES"
  614.         OUTEND "X" = "X" |{$FLINE}
  615.  
  616.     then any input line that contains "YES" starting in column 15 would be sent
  617.     to the output file.  All other lines would be ignored.
  618.  
  619.     CLUSTERED ACCEPTS: Sometimes you have to check more than one value to see
  620.     if the input line is valid.  You do this by using "clustered ACCEPTs",
  621.     which are several ACCEPT commands in a row.
  622.  
  623.     Briefly stated, if you have several ACCEPTs in a row ("clustered"), they
  624.     are all processed to determine if the input line is acceptable or not.  If
  625.     even one ACCEPT matches up, the line is accepted.  To express this in more
  626.     detail...
  627.  
  628.     When value1 contains value2, the line is accepted, and processing of the
  629.     POM file continues for that input line, even if the immediately following
  630.     ACCEPTs do NOT produce a match.  After all, we've already got a match!
  631.  
  632.     If value1 does NOT contain value2, Parse-O-Matic looks at the next commmand
  633.     in the POM file.  If it is not another ACCEPT, the input line is ignored.
  634.     If it is another ACCEPT, maybe it will product a match -- so Parse-O-Matic
  635.     moves to that command.
  636.  
  637.     The following POM file uses clustered ACCEPTs to accept any line that
  638.     contains the name "FRED" or "MARY" between columns 5 and 8, or contains the
  639.     word "MEMBER" between columns 20 and 25.
  640.  
  641.         SET    NAME = $FLINE[5 8]         (Set the variable)
  642.         ACCEPT NAME = "FRED"              (Look for FRED)
  643.         ACCEPT NAME = "MARY"              (Look for MARY)
  644.         ACCEPT $FLINE[20 25] = "MEMBER"   (Look for MEMBER)
  645.         OUTEND "X" = "X" |{$FLINE}        (Output the line if we get this far)
  646.  
  647.     The following example would NOT work, however:
  648.  
  649.         ACCEPT $FLINE[20 25] = "MEMBER"
  650.         SET    NAME = $FLINE[5 8]
  651.         ACCEPT NAME = "FRED"
  652.         ACCEPT NAME = "MARY"
  653.         OUTEND "X" = "X" |{$FLINE}
  654.  
  655.     It would not work because the ACCEPTs are not clustered; if the first
  656.     ACCEPT fails, the input line will be rejected as soon as the SET command is
  657.     encountered.  The next two ACCEPTs would not be reached in such case.
  658.                                
  659.  
  660.                                   ----------------
  661.                                   The TRIM Command
  662.                                   ----------------
  663.  
  664.                          FORMAT:  TRIM var1 spec1 character
  665.  
  666.     TRIM removes characters from var1.  This is usually used to remove blanks.
  667.  
  668.     spec1 can be:  A=All   B=Both ends   L=Left side only   R = Right side only
  669.  
  670.     For example:
  671.  
  672.         SET  PRICE = $FLINE[20 26]
  673.         TRIM PRICE "A" ","
  674.         TRIM PRICE "L" "$"
  675.  
  676.     This would remove all commas from the variable "PRICE", and remove the
  677.     leading dollar sign.  Thus:
  678.  
  679.         If the input contained the string:   "$25,783"
  680.         The first TRIM would change it to:   "$25783"
  681.         The second TRIM would change it to:  "25783"
  682.                                
  683.  
  684.                                   ---------------
  685.                                   The PAD Command
  686.                                   ---------------  
  687.  
  688.                        FORMAT:  PAD var1 spec1 character len
  689.  
  690.     PAD makes var1 a specified length, padded with a specified character.
  691.  
  692.         spec1      is "L", "R", or "C" (Left, Right or Center)
  693.         character  is the character used to pad the string
  694.         len        is the desired string length
  695.  
  696.     For example, if the variable ABC is set to "1234" ...
  697.  
  698.     PAD ABC "L" "0" "7"   left-pads it 7 characters wide with zeros ("0001234")
  699.     PAD ABC "R" " " "5"   right-pads it 5 characters wide with spaces ("1234 ")
  700.     PAD ABC "C" "*" "8"   would center it, 8 wide, with asterisks ("**1234**")
  701.  
  702.     If the length is less than the length of the string, it is unchanged.  For
  703.     example, if you set variable XYZ to "PINNACLE", then
  704.  
  705.         PAD XYZ "R" " " "3"
  706.  
  707.     would leave the string as-is ("PINNACLE").
  708.  
  709.     Thus, PAD can not be used to shorten a string.  If it was your intention to
  710.     make XYZ 3 letters long, it would be appropriate to use the SET command:
  711.  
  712.         SET XYZ = XYZ[1 3]
  713.  
  714.  
  715.                                  ------------------
  716.                                  The INSERT Command
  717.                                  ------------------
  718.  
  719.                          FORMAT:  INSERT var1 spec1 value1
  720.  
  721.     The INSERT command inserts text on the left or right of var1, or at a
  722.     "found text" position.
  723.  
  724.         spec1  is "L" or "R" (Left or Right) or a find-string (e.g.  "@HELLO")
  725.         value1 is the value to be inserted
  726.  
  727.     For example, if the variable ABC is set to "Parse-O-Matic", then
  728.  
  729.         INSERT ABC "L" "Register "    sets ABC to "Register Parse-O-Matic"
  730.         INSERT ABC "R" " is super"    sets set ABC to "Parse-O-Matic is super"
  731.  
  732.     You can use a find-string to insert text at the first occurance of the text
  733.     you specify.  For example:
  734.  
  735.         INSERT ABC "@-O-Matic" "!"    sets ABC to "Parse!-O-Matic"
  736.  
  737.     If the find-string is not found, nothing is done.
  738.                               
  739.  
  740.                                  ------------------
  741.                                  The CHANGE Command
  742.                                  ------------------
  743.  
  744.                          FORMAT:  CHANGE var1 value1 value2
  745.  
  746.     The CHANGE command replaces ALL occurances of value1 with value2.  This is
  747.     more powerful than TRIM, but is not as efficient.  Here is an example of
  748.     the CHANGE command in action:
  749.  
  750.         SET    DATE = $FLINE[31 38]
  751.         CHANGE DATE "/" "--"
  752.  
  753.     If the SET command assigned DATE the value:    "93/10/15"
  754.     Then the CHANGE command would convert it to:   "93--10--15"
  755.                               
  756.  
  757.                                  -----------------
  758.                                  The SPLIT Command
  759.                                  -----------------
  760.  
  761.        FORMAT:  SPLIT from-position to-position [,from-pos'n to-pos'n] [...]
  762.  
  763.     The maximum length of an input line from a text file is 255 characters.  If
  764.     your input file is wider than that, you must break up the file into
  765.     manageable chunks, using the SPLIT command.  This command lets you specify
  766.     the way in which each input line is broken up so that it will look like
  767.     several SEPARATE lines.
  768.  
  769.     For example, if your input lines were up to 300 characters wide, you could
  770.     specify:
  771.  
  772.         SPLIT 1 255, 256 300
  773.  
  774.     This would break up each line as if it was two lines.  (If some of the
  775.     lines were less than 256 characters they would still be treated as two
  776.     lines, though the second line would be null (i.e. empty).)
  777.  
  778.     You can specify up to 100 splits (use multiple SPLIT commands if
  779.     necessary).  With SPLIT, Parse-O-Matic can handle input records of up to
  780.     32767 characters.
  781.  
  782.     The best way of handling SPLIT or CHOPped files is to use a combination of
  783.     $SPLIT (explained in more detail later) and BEGIN/END.  For example:
  784.  
  785.         SPLIT 1 250, 251 300
  786.         BEGIN $SPLIT = "1"
  787.           SET a = $FLINE[ 1 10]
  788.           SET b = $FLINE[11 20]
  789.         END
  790.         BEGIN $SPLIT = "2"
  791.           SET x = $FLINE[ 1 10]
  792.           SET y = $FLINE[11 20]
  793.           OUTEND |{a} {b} {x} {y}
  794.         END
  795.  
  796.     This would output the data which appears (in the input file) in columns
  797.     1-10, 11-20, 251-260 and 261-280.
  798.  
  799.  
  800.                                   ----------------
  801.                                   The CHOP Command
  802.                                   ----------------
  803.  
  804.         FORMAT:  CHOP from-position to-position [,from-pos'n to-pos'n] [...]
  805.  
  806.     The CHOP command works the same way as the SPLIT command, with one
  807.     exception:  it informs Parse-O-Matic that the input is a fixed-record-
  808.     length file. In other words, it means that the input records are
  809.     distinguished by having a particular (and exact) length, rather than being
  810.     separated by end-of-line characters (Carriage Return, Linefeed) as is the
  811.     case for a standard text file.
  812.  
  813.     Thus, if you have an input file containing fixed-length records, each of
  814.     which is 200 characters wide, you could specify it like this:
  815.  
  816.         CHOP 1 200
  817.  
  818.     If the input record is more than 255 characters, you must break it up into
  819.     smaller chunks.  For example, if the input record was 300 characters wide,
  820.     you could break it up like this:
  821.  
  822.         CHOP 1 250, 251 300
  823.  
  824.     By using CHOP, Parse-O-Matic can handle input records up to 32767
  825.     characters wide.  You can use the $SPLIT variable to manage your use of
  826.     CHOP.  See the example in the section describing the SPLIT command.
  827.                               
  828.  
  829.                                  ------------------
  830.                                  The LOOKUP Command
  831.                                  ------------------
  832.  
  833.                             FORMAT:  LOOKUP var1 value1
  834.  
  835.     The LOOKUP command will search for value1 in a text file (the name of which
  836.     is specified either by the LOOKFILE command or the /L startup parameter).
  837.     When POM finds it, it sets var1 to another value found on the same line.
  838.  
  839.     Let us suppose you created a text file, named NAMES.TBL, like this:
  840.                     
  841.         R. REAGAN        Ronald Reagan
  842.         D. EISENHOWER    Dwight Eisenhower
  843.         G. BUSH          George Bush
  844.         :                :
  845.         Column 1         Column 18
  846.  
  847.     This file can be used to look up a name, as in this POM file:
  848.  
  849.         LOOKFILE "NAMES.TBL"
  850.         LOOKCOLS "1" "17" "18" "34"
  851.         SET      oldname = $FLINE[21 37]
  852.         TRIM     oldname "R" " "
  853.         LOOKUP   newname = oldname
  854.         OUTEND   |{oldname} {newname}
  855.  
  856.     The LOOKFILE command specifies the name of the look-up file.  The LOOKCOLS
  857.     command specifies the starting and end columns for both the "text-to-look-
  858.     for" field (known as the key field) and the "text-to-replace-with" field
  859.     (known as the data field).
  860.  
  861.     The LOOKUP command will look for oldname in NAMES.TBL.  If oldname is set
  862.     to "G. BUSH", LOOKUP sets newname to "George Bush".  If, however, oldname
  863.     is set to "G. WASHINGTON", which doesn't appear in NAMES.TBL, newname
  864.     is set to "" (that is to say, an empty string).
  865.  
  866.     There is no limit to the number of lines that you can put in a look-up
  867.     file.  However, the more lines there are, the longer it will take to
  868.     process (because there is more to search).  The maximum length of a line
  869.     in a look-up file is 255 characters.
  870.  
  871.     In the look-up file, null (empty) lines are ignored.  You can also include
  872.     comments in the file by starting the line with a semi-colon:
  873.  
  874.         ; Some of the Presidents of the United States
  875.         R. REAGAN        Ronald Reagan
  876.         D. EISENHOWER    Dwight Eisenhower
  877.         G. BUSH          George Bush
  878.  
  879.     The LOOKUP command can be used for more than just names, of course.  You
  880.     could use it to look up prices, phone numbers, addresses and so on.
  881.  
  882.  
  883.                                 --------------------
  884.                                 The LOOKFILE Command
  885.                                 --------------------
  886.  
  887.                               FORMAT:  LOOKFILE value1
  888.  
  889.     The LOOKFILE command specifies the name of the look-up file for the next
  890.     LOOKUP command.  This lets you use several look-up files in one POM file.
  891.     For example:
  892.  
  893.         SET name = $FLINE[1 20]
  894.         ; Look up full name
  895.         LOOKFILE "NAMES.TBL"
  896.         LOOKCOLS "1" "25" "30" "50"
  897.         LOOKUP   fullname = name
  898.         ; Look up phone number
  899.         LOOKFILE "PHONE.TBL"
  900.         LOOKCOLS "1" "25" "30" "40"
  901.         LOOKUP   phone = name
  902.         ; Output result
  903.         OUTEND   |{name} {fullname} {newname}
  904.  
  905.     If you only have one look-up file, you may omit the LOOKFILE command and
  906.     specify the file name on the command line, using the /L parameter.  For
  907.     example, you could write a POM file like this:
  908.  
  909.         SET name = $FLINE[1 20]
  910.         ; Look up full name
  911.         LOOKCOLS "1" "25" "30" "50"
  912.         LOOKUP   fullname = name
  913.         ; Output result
  914.         OUTEND   |{name} {fullname}
  915.  
  916.     Your POM command could then look like this:
  917.  
  918.         POM MYPOM.POM INPUT.TXT OUTPUT.TXT /LC:\MYFILES\NAMES.TBL
  919.  
  920.     This technique allows you to use several different look-up files with the
  921.     same POM file, simply by changing the command line.
  922.                              
  923.  
  924.                                 --------------------
  925.                                 The LOOKCOLS Command
  926.                                 --------------------
  927.  
  928.                    FORMAT:  LOOKCOLS value1 value2 value3 value4
  929.  
  930.     The LOOKCOLS command specifies the starting and ending columns for the
  931.     key and data fields in a look-up file (see the explanation of the LOOKUP
  932.     command for an overview of look-up files).
  933.  
  934.         value1 specifies the starting column for the key  field
  935.         value2 specified the  ending  column for the key  field
  936.         value3 specifies the starting column for the data field
  937.         value4 specified the  ending  column for the data field
  938.  
  939.     You can specify a null value to indicate "same as last time".  For example:
  940.  
  941.         SET name = $FLINE[1 20]
  942.         LOOKFILE "NAMES.TBL"
  943.         LOOKCOLS "1" "25" "30" "50"
  944.         LOOKUP   fullname = name
  945.         LOOKFILE "PHONE.TBL"
  946.         LOOKCOLS "" "" "" "40"
  947.         LOOKUP   phonenum = name
  948.         OUTEND   |{name} {fullname} {phonenum}
  949.  
  950.     The second LOOKCOLS command uses the same numbers for the first three
  951.     values that the first LOOKCOLS command used.
  952.  
  953.     If you do not specify a LOOKCOLS command, the default values are:
  954.  
  955.        Key Field:   Starting column  =   1
  956.                     Ending column    =  10
  957.        Data Field:  Starting column  =  12
  958.                     Ending column    = 255
  959.  
  960.     This is equivalent to LOOKCOLS "1" "10" "12" "255".
  961.  
  962.  
  963.                                 --------------------
  964.                                 The LOOKSPEC Command
  965.                                 --------------------
  966.  
  967.                        FORMAT:  LOOKSPEC value1 value2 value3
  968.  
  969.     The LOOKSPEC command configures the way the next LOOKUP command will work.
  970.                                                 
  971.         value1 = Trim             ("Y" or "N" -- default "Y")
  972.         value2 = Sorted           ("Y" or "N" -- default "N")
  973.         value3 = Case-sensitive   ("Y" or "N" -- default "N")
  974.  
  975.     The Trim setting specifies whether or not the data field should have spaces
  976.     stripped off both ends.
  977.  
  978.     The Sorted setting specifies whether or not the look-up file is sorted by
  979.     the key field.  A sorted file is much faster than an unsorted file.  This
  980.     is especially noticeable if you have a large look-up file and a lot of
  981.     input to process.
  982.  
  983.     The Case-sensitive setting specifies whether or not LOOKUP should distin-
  984.     guish between upper and lower case when searching.  The default setting is
  985.     "N" (No), so that LOOKUP would find "John Smith", even if it appeared in
  986.     the look-up file as "JOHN SMITH".  It is usually safest to set Case-
  987.     sensitivity to "N", but if you set it to "Y", searching is slightly faster.
  988.  
  989.     You can specify a null value to indicate "same as last time".  For example:
  990.  
  991.         SET name = $FLINE[1 20]
  992.         LOOKFILE "DATA.TBL"
  993.         LOOKCOLS "1" "25" "30" "50"
  994.         LOOKSPEC "Y" "Y" "Y"
  995.         LOOKUP   fullname = name
  996.         LOOKCOLS "" "" "60" "70"
  997.         LOOKSPEC "N" "" ""
  998.         LOOKUP   phonenum = name
  999.         OUTEND   |{name} {fullname} {phonenum}
  1000.  
  1001.     The second LOOKSPEC command uses the same settings for Sorted and Case-
  1002.     sensitivity as the first one, but specifies a different Trim setting.
  1003.  
  1004.  
  1005.                                  -----------------
  1006.                                  The TRACE Command
  1007.                                  -----------------
  1008.  
  1009.                                 FORMAT:  TRACE var1
  1010.  
  1011.     The TRACE command is an alternative to standard tracing (see "Tracing", in
  1012.     the "Terms and Techniques" section).
  1013.  
  1014.     When you include a TRACE command in your POM file, Parse-O-Matic will
  1015.     create a text file, named POM.TRC, and use it to keep a detailed record of
  1016.     POM's processing.  Here is an example of the TRACE command:
  1017.  
  1018.     TRACE PRICE
  1019.  
  1020.     This traces the variable named "PRICE".  After processing, the file POM.TRC
  1021.     will show everything that happened, and give the value of PRICE at the
  1022.     TRACE line.
  1023.  
  1024.     NOTE:  Since trace files are so detailed, they can be very large.  If you
  1025.     are trying to debug a POM file using TRACE, it is a good idea to use a
  1026.     small input file.
  1027.  
  1028.  
  1029.  
  1030.     ===========================================================================
  1031.                                 TERMS AND TECHNIQUES
  1032.     ===========================================================================
  1033.  
  1034.  
  1035.                                        ------
  1036.                                        VALUES
  1037.                                        ------
  1038.  
  1039.     A value can be specified in the following ways:
  1040.  
  1041.         "text"              A literal text string
  1042.         #number             A single ASCII character (e.g. #32 = Space)
  1043.         #number#number...   Several ASCII characters (e.g. #32#32 = 2 Spaces)
  1044.         VARNAME             The name of a variable
  1045.         VARNAME[start end]  A substring of a variable
  1046.         VARNAME[start]      A single character
  1047.         VARNAME+            Incremented variable (see explanation below)
  1048.  
  1049.     Variable names can be up to 8 characters long.  There is no distinction
  1050.     between upper and lower case in the variable name.  You can create up to
  1051.     220 variables and literals.
  1052.  
  1053.     The # character is used to specify a literal text string of one or more
  1054.     characters.  Follow each # with the decimal value of the ASCII character
  1055.     you want.  Here are some useful values:
  1056.  
  1057.         #10 = Line Feed   #12 = Form Feed   #13 = Carriage Return
  1058.  
  1059.     Parse-O-Matic predefines several variables.  They are:
  1060.  
  1061.         $FLINE = The line just read from the file (max. length 255 characters)
  1062.         $FLUPC = The line just read from the file, in uppercase
  1063.         $BRL   = The { character (used in OUT)
  1064.         $BRR   = The } character (used in OUT)
  1065.         $TAB   = The tab character (Hex $09; ASCII 09)
  1066.         $SPLIT = The CHOP or SPLIT number you are currently processing
  1067.  
  1068.     Since $FLINE has a maximum length of 255 characters, you will have to use
  1069.     the SPLIT or CHOP command if your input file is wider than that.  The
  1070.     $SPLIT variable reports which segment you are processing.  For example,
  1071.     if you had this command...
  1072.  
  1073.       CHOP 1 255, 256 380
  1074.  
  1075.     then $SPLIT would be set to "1" when it was processing columns 1 to 255,
  1076.     and it would be set to "2" when it was processing columns 256 to 380.
  1077.  
  1078.  
  1079.                                      ----------
  1080.                                      DELIMITERS
  1081.                                      ----------
  1082.  
  1083.     If you need to specify a quotation mark, use "".  For example:
  1084.  
  1085.         IGNORE $FLINE = "He said ""Hello"" to me."
  1086.  
  1087.     This would ignore lines containing:  He said "Hello" to me.
  1088.  
  1089.  
  1090.                                  ------------------
  1091.                                  ILLEGAL CHARACTERS
  1092.                                  ------------------
  1093.  
  1094.     No command can contain these ASCII characters:
  1095.  
  1096.         HEX   DECIMAL   NAME
  1097.         ---   -------   --------------------
  1098.         $00      0      NULL
  1099.         $0A     10      LF (Linefeed)
  1100.         $0D     13      CR (Carriage Return)
  1101.  
  1102.     Of course, LF and CR do appear at the end of each line, in a text file.
  1103.  
  1104.  
  1105.                                     ------------
  1106.                                     INCREMENTING
  1107.                                     ------------
  1108.  
  1109.     Only numeric incrementing is supported.  Attempting to increment another
  1110.     type of variable will result in an error.
  1111.  
  1112.     - Incrementing "1" gives you "2"
  1113.     - Incrementing "9" gives you "10"
  1114.  
  1115.     The first time a variable is referenced, it has a null value.  If you
  1116.     increment this, it will be changed from "" (i.e.  null) to "1".
  1117.  
  1118.  
  1119.                                    -------------
  1120.                                    LINE COUNTERS
  1121.                                    -------------
  1122.  
  1123.     If your input record is divided over several lines (due to its original
  1124.     format or perhaps because you used the SPLIT or CHOP command), it is
  1125.     helpful to set up a line counter.  The following example would extract the
  1126.     first six characters of the second line of input records that span three
  1127.     lines (designated lines 0, 1 & 2):
  1128.  
  1129.         IF     LineCntr = "1" THEN MyField = $FLINE[1 6]
  1130.         OUTEND LineCntr = "1" |{MyField}
  1131.         IF     LineCntr = "2" THEN LineCntr = "" ELSE LineCntr+
  1132.  
  1133.  
  1134.                                       -------
  1135.                                       TRACING
  1136.                                       -------
  1137.  
  1138.     By setting the DOS variable POM to ALL, you can generate a trace file,
  1139.     named POM.TRC.  This is helpful if you have trouble understanding why your
  1140.     file isn't being parsed properly.  But be sure to test it with a SMALL
  1141.     input file; the trace is quite detailed, and it can easily generate a huge
  1142.     output file.
  1143.  
  1144.     To save space, you can specify a particular list of variables to be traced,
  1145.     rather than tracing everything.  For example, to trace only the variable
  1146.     PRICE, enter this DOS command:
  1147.  
  1148.         SET POM=PRICE
  1149.  
  1150.     To trace several variables, separate the variable names by slashes, as in
  1151.     this example:
  1152.  
  1153.         SET POM=PRICE/BONUS/NAME
  1154.  
  1155.     This would trace the three variables PRICE, BONUS and NAME.
  1156.  
  1157.  
  1158.                                      ----------
  1159.                                      QUIET MODE
  1160.                                      ----------
  1161.  
  1162.     Sometimes you don't want the user to see the Parse-O-Matic processing
  1163.     screen.  In such cases, you can use the "Quiet Mode" switch (/Q) on the
  1164.     command line.  For example:
  1165.  
  1166.         POM XYZ.POM MYFILE.TXT TEMP.TXT /Q
  1167.  
  1168.     The /Q switch suppresses the display of the processing screen.  The only
  1169.     time a user will see anything is if there is a problem (for example:  the
  1170.     input file was not found).    
  1171.  
  1172.                                      ---------
  1173.                                      DBF FILES
  1174.                                      ---------
  1175.  
  1176.     If Parse-O-Matic notices that the input file is a DBase file (i.e. it has a
  1177.     DBF extension -- for example:  MYFILE.DBF), it will process the data
  1178.     somewhat differently.  For instance, the variable $FLINE is not defined.
  1179.     Rather, each of the fields in the database are pre-parsed.  Thus, if you
  1180.     have a DBF file containing three fields (EMPNUM, NAME, PHONE), your entire
  1181.     POM file might look like this:
  1182.  
  1183.         IGNORE DELETED "Y"
  1184.         OUTEND |{EMPNUM} {NAME} {PHONE}
  1185.  
  1186.     The DELETED variable is created automatically for each record.  If it is
  1187.     set to "Y", it means the record has been deleted from the database and is
  1188.     probably not valid.  In most cases, you will want to ignore such records.
  1189.  
  1190.     If you do not know what the field names are, you can obtain the list with
  1191.     the following POM file:
  1192.  
  1193.         TRACE DELETED
  1194.  
  1195.     Afterwards, when you inspect the trace file (POM.TRC), you will see a
  1196.     summary of all the fields.  Since there are no output commands (e.g. OUTEND
  1197.     and OUTHDG), the output file will be empty.
  1198.  
  1199.  
  1200.                           --------------------------------
  1201.                           CONVERTING COMMA-DELIMITED FILES
  1202.                           --------------------------------
  1203.  
  1204.     It is possible (but rather difficult) to create a POM file that will
  1205.     convert comma-delimited files to columnar format.  Fortunately, Pinnacle
  1206.     Software has a useful utility (named CCDF) which can do this very easily.
  1207.     When you register Parse-O-Matic, we will send you an evaluation copy of
  1208.     CCDF.  If you are in a hurry, you can download a copy from our free files
  1209.     BBS at 514-345-8654.  (Sign on as GUEST -- no password needed -- and enter
  1210.     the command GET CCDF to start downloading the file CCDF.ZIP.  The default
  1211.     download protocol is ZMODEM, but you can change this with the PROTOCOL
  1212.     command.)
  1213.  
  1214.  
  1215.                                       --------
  1216.                                       EXAMPLES
  1217.                                       --------
  1218.  
  1219.     Most of these techniques are demonstrated by the examples provided with the
  1220.     standard Parse-O-Matic package.  To see these examples, switch to your
  1221.     Parse-O-Matic directory and type START at the DOS prompt.
  1222.  
  1223.  
  1224.  
  1225.